import 'package:simulator/typedef/simu_option.dart';

final Option simuLegacyDriveOpts = Option(name: 'driver', desc: const [
  OptDescription(name: 'bus', type: OptType.number, help: 'bus number'),
  OptDescription(
      name: 'unit',
      type: OptType.number,
      help: 'unit number (i.e. lun for scsi)'),
  OptDescription(name: 'index', type: OptType.number, help: 'index number'),
  OptDescription(
      name: 'media', type: OptType.string, help: 'media type (disk, cdrom)'),
  OptDescription(
      name: 'if',
      type: OptType.string,
      help: 'interface (ide, scsi, sd, mtd, floppy, pflash, virtio)'),
  OptDescription(name: 'file', type: OptType.string, help: 'file name'),
  /* Options that are passed on, but have special semantics with -drive */
  OptDescription(
      name: 'read-only',
      type: OptType.bool,
      help: 'open drive file as read-only'),
  OptDescription(
      name: 'rerror', type: OptType.string, help: 'read error action'),
  OptDescription(
      name: 'werror', type: OptType.string, help: 'write error action'),
  OptDescription(
      name: 'copy-on-read',
      type: OptType.bool,
      help: 'copy read data from backing file into image file')
]);

final Option simuCommonDriveOpts = Option(name: 'driver', desc: const [
  OptDescription(
      name: 'snapshot',
      type: OptType.bool,
      help: 'enable/disable snapshot mode'),
  OptDescription(
      name: 'aio',
      type: OptType.string,
      help: 'host AIO implementation (threads, native, io_uring)'),
  OptDescription(
      name: 'cache.writeback',
      type: OptType.bool,
      help: 'Enable writeback mode'),
  OptDescription(
      name: 'format',
      type: OptType.string,
      help: 'disk format (raw, qcow2, ...)'),
  OptDescription(
      name: 'rerror', type: OptType.string, help: 'read error action'),
  OptDescription(
      name: 'werror', type: OptType.string, help: 'write error action'),
  OptDescription(
      name: 'read-only',
      type: OptType.bool,
      help: 'open drive file as read-only'),
  OptDescription(
      name: 'throttling.iops-total',
      type: OptType.number,
      help: 'limit total I/O operations per second'),
  OptDescription(
      name: 'throttling.iops-read',
      type: OptType.number,
      help: 'limit read operations per second'),
  OptDescription(
      name: 'throttling.iops-write',
      type: OptType.number,
      help: 'limit write operations per second'),
  OptDescription(
      name: 'throttling.bps-total',
      type: OptType.number,
      help: 'limit total bytes per second'),
  OptDescription(
      name: 'throttling.bps-read',
      type: OptType.number,
      help: 'limit read bytes per second'),
  OptDescription(
      name: 'throttling.bps-write',
      type: OptType.number,
      help: 'limit write bytes per second'),
  OptDescription(
      name: 'throttling.iops-total-max',
      type: OptType.number,
      help: 'I/O operations burst'),
  OptDescription(
      name: 'throttling.iops-read-max',
      type: OptType.number,
      help: 'I/O operations read burst'),
  OptDescription(
      name: 'throttling.iops-write-max',
      type: OptType.number,
      help: 'I/O operations write burst'),
  OptDescription(
      name: 'throttling.bps-total-max',
      type: OptType.number,
      help: 'total bytes burst'),
  OptDescription(
      name: 'throttling.bps-read-max',
      type: OptType.number,
      help: 'total bytes read burst'),
  OptDescription(
      name: 'throttling.bps-write-max',
      type: OptType.number,
      help: 'total bytes write burst'),
  OptDescription(
      name: 'throttling.iops-total-max-length',
      type: OptType.number,
      help: 'length of the iops-total-max burst period, in seconds'),
  OptDescription(
      name: 'throttling.iops-read-max-length',
      type: OptType.number,
      help: 'length of the iops-read-max burst period, in seconds'),
  OptDescription(
      name: 'throttling.iops-write-max-length',
      type: OptType.number,
      help: 'length of the iops-write-max burst period, in seconds'),
  OptDescription(
      name: 'throttling.bps-total-max-length',
      type: OptType.number,
      help: 'length of the bps-total-max burst period, in seconds'),
  OptDescription(
      name: 'throttling.bps-read-max-length',
      type: OptType.number,
      help: 'length of the bps-read-max burst period, in seconds'),
  OptDescription(
      name: 'throttling.bps-write-max-length',
      type: OptType.number,
      help: 'length of the bps-write-max burst period, in seconds'),
  OptDescription(
      name: 'throttling.iops-size',
      type: OptType.number,
      help: 'when limiting by iops max size of an I/O in bytes'),
  OptDescription(
      name: 'throttling.group',
      type: OptType.string,
      help: 'name of the block throttling group'),
  OptDescription(
      name: 'copy-on-read',
      type: OptType.bool,
      help: 'copy read data from backing file into image file'),
  OptDescription(
      name: 'tdetect-zeroes',
      type: OptType.string,
      help: 'try to optimize zero writes (off, on, unmap)'),
  OptDescription(
      name: 'stats-account-invalid',
      type: OptType.bool,
      help: 'whether to account for invalid I/O operations\nin the statistics'),
  OptDescription(
      name: 'stats-account-failed',
      type: OptType.bool,
      help: 'whether to account for failed I/O operations\nin the statistics'),
]);

final Option simuDriveOpts = Option(
  name: 'driver',
);
